package com.tfj.mvp.tfj.home.adapter;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.view.View;
import android.widget.RelativeLayout;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.hyphenate.tfj.R;
import com.jakewharton.rxbinding2.view.RxView;
import com.tfj.comm.bean.Constant;
import com.tfj.mvp.tfj.detail.VDetailActivity;
import com.tfj.mvp.tfj.home.bean.HouseDataBean;
import com.tfj.mvp.tfj.home.bean.TypeListBean;
import com.tfj.utils.AntiShakeUtils;

import java.util.concurrent.TimeUnit;

public class HouseDataAdapter extends BaseQuickAdapter<HouseDataBean, BaseViewHolder> {
    private Context context;
    public HouseDataAdapter( Context context) {
        super(R.layout.item_rank);
        this.context = context;
    }

    @Override
    protected void convert(BaseViewHolder viewHolder, final HouseDataBean item) {
        RelativeLayout rl_out = viewHolder.getView(R.id.rl_out);
        rl_out.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                if(AntiShakeUtils.isInvalidClick(v)){
                    return;
                }
                context.startActivity(new Intent(context, VDetailActivity.class));
                ((Activity)  context). overridePendingTransition(R.anim.ap2, R.anim.ap1);// 淡出淡入动画效果
            }
        });
    }

}
